Skip to content

fix: convert wa-row voiced kana (U+30F8/U+30F9) in toHiraganaCase and toKatakanaCase#62

Open
greymoth-jp wants to merge 1 commit into
polygonplanet:masterfrom
greymoth-jp:fix-wa-row-voiced-kana
Open

fix: convert wa-row voiced kana (U+30F8/U+30F9) in toHiraganaCase and toKatakanaCase#62
greymoth-jp wants to merge 1 commit into
polygonplanet:masterfrom
greymoth-jp:fix-wa-row-voiced-kana

Conversation

@greymoth-jp

Copy link
Copy Markdown

toHiraganaCase and toKatakanaCase already handle two of the four wa-row voiced katakana: (U+30F7) is decomposed to わ゛ and (U+30FA) to を゛, and toKatakanaCase composes them back. The other two, (U+30F8) and (U+30F9), were left out, so they pass through unconverted:

Encoding.toHiraganaCase('ヷヸヹヺ');      // 'わ゛ヸヹを゛'  (ヸ/ヹ unchanged)
Encoding.toKatakanaCase('わ゛ゐ゛ゑ゛を゛'); // 'ヷヰ゛ヱ゛ヺ'  (ゐ゛/ゑ゛ not composed)

The base letters / already convert to / through the usual katakana/hiragana offset, so the voiced forms now follow the same pattern as /:

Encoding.toHiraganaCase('ヷヸヹヺ');      // 'わ゛ゐ゛ゑ゛を゛'
Encoding.toKatakanaCase('わ゛ゐ゛ゑ゛を゛'); // 'ヷヸヹヺ'

Added a test covering the round-trip for the full wa-row voiced family. npm test passes.

toHiraganaCase already decomposes ヷ (U+30F7) to わ゛ and ヺ (U+30FA) to を゛,
and toKatakanaCase composes them back, but the other two wa-row voiced
katakana ヸ (U+30F8) and ヹ (U+30F9) were left out and passed through
unconverted. The base letters ヰ/ヱ already map to ゐ/ゑ, so the voiced forms
now follow the same pattern: ヸ <=> ゐ゛, ヹ <=> ゑ゛.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant